home *** CD-ROM | disk | FTP | other *** search
- property ichCurrent, ichStart, inChannels, iRightAnswer
-
- on birth me, startCh, nChannels, rightAnswer, defaultAnswer
- set ichStart to startCh
- set inChannels to nChannels
- repeat with ch = ichStart to ichStart + inChannels - 1
- puppetSprite(ch, 1)
- end repeat
- if voidp(rightAnswer) then
- set iRightAnswer to 0
- else
- set iRightAnswer to rightAnswer
- end if
- if voidp(defaultAnswer) then
- set ichCurrent to 0
- else
- if defaultAnswer = 0 then
- set ichCurrent to 0
- else
- set ichCurrent to ichStart + defaultAnswer - 1
- set the castNum of sprite ichCurrent to the castNum of sprite ichCurrent + 1
- updateStage()
- end if
- end if
- return me
- end
-
- on mHit me
- set newCh to the clickOn
- if ichCurrent <> 0 then
- if newCh = ichCurrent then
- return
- end if
- set the castNum of sprite ichCurrent to the castNum of sprite ichCurrent - 1
- end if
- set ichCurrent to newCh
- set the castNum of sprite ichCurrent to the castNum of sprite ichCurrent + 1
- updateStage()
- end
-
- on mGetChosenAnswer me
- if ichCurrent = 0 then
- return 0
- else
- return ichCurrent - ichStart + 1
- end if
- end
-
- on mEvaluate me
- if iRightAnswer = 0 then
- alert("Attempting to evaluate, but a correct was not given at initialization")
- return 0
- end if
- set currentAnswer to mGetChosenAnswer(me)
- if currentAnswer = iRightAnswer then
- return 1
- else
- return 0
- end if
- end
-
- on mCleanUp me
- repeat with ch = ichStart to ichStart + inChannels
- puppetSprite(ch, 0)
- end repeat
- end
-